<template>
	<view class="choose">
		<QSNavbar :navbarItems="navbarItems_1" backgroundColor="#ffffff">
		</QSNavbar>
		<view class="" v-if="tabsList !='' && tabsList !=null">
			<u-sticky>
				<u-tabs :list="tabsList" lineColor="#4786fe" :activeStyle="{
					color: '#4786fe'
				}" :inactiveStyle="{
					color: '#c2c1c1' 
				}" :lineWidth="30" :current="currentTab" @click="onClickTab" />
			</u-sticky>
			<view class="choose-list">
				<view v-for="item in detail.list" :key="item.id" class="item">
					<!-- <block v-if="type == 0">
						<view class="top flex-align">
							<u-image :src="`${assetsPath}44d8d751bb60e10cc8e83c114d488541605662f5.png`" width="30rpx"
								height="30rpx" shape="square"></u-image>
							<view style="margin-left: 13rpx;">{{ item.name }}</view>
						</view>
						<view class="it">
							<view class="content d-flex">
								<u-image :src="item.picture" width="160rpx" height="160rpx" shape="square"></u-image>
								<view class="right-content d-flex flex-grow-1 flex-column">
									<view class="flex-between">
										<view>{{ item.name }}</view>
										<view style="color: #2f75fa;">待使用</view>
									</view>
									<view>
										<view class="flex-between">
											<view v-if="item.yxq != '长期有效'" class="count">
												{{item.days}}天
											</view>
											<view v-else>
					
											</view>
											<view class="date" v-if="item.inventory === 0">有效期{{ item.sku_info }}</view>
											<view class="date" v-if="item.inventory === 1">{{ item.yxq }}</view>
										</view>
									</view>
								</view>
							</view>
					
							<view class="bottom d-flex justify-end">
								<view class="d-flex">
									<u-button text="查看劵码" shape="circle" @click="onClick(item)"
										color="linear-gradient(0deg, rgb(47, 117, 250) 0%, rgb(82, 142, 255) 100%);">
									</u-button>
								</view>
							</view>
						</view>
					</block> -->
					<!-- 票 -->
					<block v-if="type == 'ticket'">
						<view class="top flex-align">
							<!-- <u-image width="56rpx" height="56rpx" shape="circle"></u-image> -->
							<u-image :src="`${assetsPath}44d8d751bb60e10cc8e83c114d488541605662f5.png`" width="30rpx"
								height="30rpx" shape="square"></u-image>
							<view style="margin-left: 13rpx;">{{ item.venue_name }}</view>
						</view>
						<view class="it">
							<view class="content d-flex">
								<!-- <u-image width="160rpx" height="160rpx" radius="12rpx"></u-image> -->
								<u-image :src="item.goods_image" width="160rpx" height="160rpx" shape="square">
								</u-image>
								<view class="right-content d-flex flex-grow-1 flex-column">
									<view class="flex-between">
										<view  style="width: 80%;">{{ item.goods_name }}</view>
										<view style="color: #2f75fa;">待使用</view>
									</view>
									<view>
										<view class="flex-between">
											<!-- <price :value="item.price"></price> -->
											<!-- <view class="count">{{ item.days }}天 </view> -->
											<view v-if="item.yxq != '长期有效'" class="count">
												{{item.days}}天
											</view>
											<view v-else>

											</view>
											<view class="date" v-if="item.inventory === 0">有效期{{ item.sku_info }}</view>
											<view class="date" v-if="item.inventory === 1">{{ item.yxq }}</view>
										</view>
									</view>
								</view>
							</view>

							<view class="bottom d-flex justify-end">
								<view class="d-flex">
									<!-- <view class="" style="margin-right: 10rpx;">
										<u-button text="适用场馆" shape="circle" @click="showVenues(item)"
											color="linear-gradient(0deg, rgb(47, 117, 250) 0%, rgb(82, 142, 255) 100%);">
										</u-button>
									</view> -->
									<view class="">
										<u-button text="查看劵码" shape="circle" @click="onClick(item)"
											color="linear-gradient(0deg, rgb(47, 117, 250) 0%, rgb(82, 142, 255) 100%);">
										</u-button>
									</view>


								</view>
							</view>
						</view>
					</block>
					<!-- 卡 -->
					<block v-if="type == 'card'">
						<view class="top flex-align">
							<!-- <u-image width="56rpx" height="56rpx" shape="circle"></u-image> -->
							<u-image :src="`${assetsPath}44d8d751bb60e10cc8e83c114d488541605662f5.png`" width="30rpx"
								height="30rpx" shape="square"></u-image>
							<view style="margin-left: 13rpx;">{{ item.venue_name }}</view>
						</view>
						<view class="it">
							<view class="content d-flex">
								<!-- <u-image width="160rpx" height="160rpx" radius="12rpx"></u-image> -->
								<u-image :src="item.goods_image" width="160rpx" height="160rpx" shape="square">
								</u-image>
								<view class="right-content d-flex flex-grow-1 flex-column">
									<view class="flex-between">
										<view  style="width: 80%;">{{ item.goods_name }}</view>
										<view style="color: #2f75fa;">待使用</view>
									</view>
									<!-- <view class="">
										<view class="date">no.<text>{{ item.cardno }}</text></view>
									</view> -->
									<view>
										<view class="flex-between">
											<!-- <price :value="item.price"></price> -->
											<view class="count">{{ item.account_balance }}</view>
											<view class="date">{{ item.yxq }}</view>
										</view>
									</view>
								</view>
							</view>

							<view class="bottom d-flex justify-end">
								<view class="d-flex">
									<!-- <view class="" style="margin-right: 10rpx;">
										<u-button text="适用场馆" shape="circle" @click="showVenues(item)"
											color="linear-gradient(0deg, rgb(47, 117, 250) 0%, rgb(82, 142, 255) 100%);">
										</u-button>
									</view> -->
									<u-button text="查看劵码" shape="circle" @click="onClick(item)"
										color="linear-gradient(0deg, rgb(47, 117, 250) 0%, rgb(82, 142, 255) 100%);">
									</u-button>
								</view>
							</view>
						</view>
					</block>
					<!-- 场地 -->
					<block v-if="type == 'court'">
						<view class="top flex-align">
							<!-- <u-image width="56rpx" height="56rpx" shape="circle"></u-image> -->
							<u-image :src="`${assetsPath}44d8d751bb60e10cc8e83c114d488541605662f5.png`" width="30rpx"
								height="30rpx" shape="square"></u-image>
							<view style="margin-left: 13rpx;">{{ item.venue_name }}</view>
						</view>
						<view class="it">
							<view class="content d-flex">
								<!-- <u-image width="160rpx" height="160rpx" radius="12rpx"></u-image> -->
								<u-image :src="item.goods.goods_image" width="160rpx" height="160rpx" shape="square">
								</u-image>
								<view class="right-content d-flex flex-grow-1 flex-column">
									<view class="flex-between">
										<view  style="width: 80%;">{{ item.goods_name }}</view>
										<view style="color: #2f75fa;">待使用</view>
									</view>
									<view class="flex-between" v-if="item.beShare == 1">
										<view style="color: #999999;">球友分享</view>
									</view>
									<!-- v-if="item.beShare == 1" -->
									<!-- <view class="">
										<view class="date">no.<text>{{ item.cardno }}</text></view>
									</view> -->
									<view>
										<view class="flex-between">
											<!-- <price :value="item.price"></price> -->
											<view class="count">{{ item.start_time }}-{{ item.end_time }}</view>
											<!-- <view class="date">{{ item.end_time }}</view> -->
										</view>
									</view>
								</view>
							</view>

							<view class="bottom d-flex justify-end">
								<view class="d-flex">
									<!-- <view class="" style="margin-right: 10rpx;">
										<u-button text="适用场馆" shape="circle" @click="showVenues(item)"
											color="linear-gradient(0deg, rgb(47, 117, 250) 0%, rgb(82, 142, 255) 100%);">
										</u-button>
									</view> -->
									<u-button text="查看劵码" shape="circle" @click="onClick(item)"
										color="linear-gradient(0deg, rgb(47, 117, 250) 0%, rgb(82, 142, 255) 100%);">
									</u-button>
								</view>
							</view>
						</view>
					</block>
					<!-- 培训班 -->
					<block v-if="type == 'train'">
						<view class="top flex-align">
							<!-- <u-image width="56rpx" height="56rpx" shape="circle"></u-image> -->
							<u-image :src="`${assetsPath}44d8d751bb60e10cc8e83c114d488541605662f5.png`" width="30rpx"
								height="30rpx" shape="square"></u-image>
							<view style="margin-left: 13rpx;">{{ item.salevenue }}</view>
						</view>
						<view class="it">
							<view class="content d-flex">
								<!-- <u-image width="160rpx" height="160rpx" radius="12rpx"></u-image> -->
								<u-image :src="item.cover" width="160rpx" height="160rpx" shape="square">
								</u-image>
								<view class="right-content d-flex flex-grow-1 flex-column">
									<view class="flex-between">
										<view  style="width: 80%;">{{ item.name }}</view>
										<view style="color: #2f75fa;">待使用</view>
									</view>
									<!-- v-if="item.beShare == 1" -->
									<view class="">
										<view class="date"><text>{{ item.student_name }}</text></view>
										<view class="date"><text>{{ item.custodian_mobile }}</text></view>
									</view>
									<view>
										<view class="flex-between">
											<!-- <price :value="item.price"></price> -->
											<view class="count" v-if="item.train_enum_id == 1">{{ item.sku }}</view>
											<view class="count" v-else>{{item.area_name}}{{item.train_class_name}}{{item.train_item_name}}</view>
											<!-- <view class="date">{{ item.end_time }}</view> -->
										</view>
									</view>
								</view>
							</view>

							<view class="bottom d-flex justify-end">
								<view class="d-flex">
									<!-- <view class="" style="margin-right: 10rpx;">
										<u-button text="适用场馆" shape="circle" @click="showVenues(item)"
											color="linear-gradient(0deg, rgb(47, 117, 250) 0%, rgb(82, 142, 255) 100%);">
										</u-button>
									</view> -->
									<u-button text="查看劵码" shape="circle" @click="onClick(item)"
										color="linear-gradient(0deg, rgb(47, 117, 250) 0%, rgb(82, 142, 255) 100%);">
									</u-button>
								</view>
							</view>
						</view>
					</block>
					<!-- 赛事 -->
					<block v-if="type == 'enroll'">
						<view class="top flex-align">
							<!-- <u-image width="56rpx" height="56rpx" shape="circle"></u-image> -->
							<u-image :src="`${assetsPath}44d8d751bb60e10cc8e83c114d488541605662f5.png`" width="30rpx"
								height="30rpx" shape="square"></u-image>
							<view style="margin-left: 13rpx;">{{ item.salevenue }}</view>
						</view>
						<view class="it">
							<view class="content d-flex">
								<!-- <u-image width="160rpx" height="160rpx" radius="12rpx"></u-image> -->
								<u-image :src="item.race_img" width="160rpx" height="160rpx" shape="square">
								</u-image>
								<view class="right-content d-flex flex-grow-1 flex-column">
									<view class="flex-between">
										<view style="width: 80%;">{{ item.race_name }}</view>
										<view style="color: #2f75fa;">待使用</view>
									</view>
									
									<view>
										<view class="flex-between">
											<!-- <price :value="item.price"></price> -->
											<view class="count">{{ item.start_time }}-{{ item.end_time }}</view>
											<!-- <view class="date">{{ item.end_time }}</view> -->
										</view>
									</view>
								</view>
							</view>

							<view class="bottom d-flex justify-end">
								<view class="d-flex">
									<!-- <view class="" style="margin-right: 10rpx;">
										<u-button text="适用场馆" shape="circle" @click="showVenues(item)"
											color="linear-gradient(0deg, rgb(47, 117, 250) 0%, rgb(82, 142, 255) 100%);">
										</u-button>
									</view> -->
									<u-button text="查看劵码" shape="circle" @click="onClick(item)"
										color="linear-gradient(0deg, rgb(47, 117, 250) 0%, rgb(82, 142, 255) 100%);">
									</u-button>
								</view>
							</view>
						</view>
					</block>
				</view>
				<!-- <view class="" style="width: 100%; height: 100rpx;"></view> -->
				<u-loadmore :status="status" loading-text="努力加载中" loadmore-text="点击加载更多" nomore-text="实在没有了"
					:line="true" @loadmore="loadNewsList" color="#999999" fontSize="11px" />
			</view>
		</view>
		<!-- <u-empty v-else text="暂无数据" icon="https://sass-test.doit10019.com/upload/202501/08114139-33838600519097990.jpg?attname=coupon.jpg" /> -->
		<u-empty v-if="tabsList == null || tabsList == '' " text="暂无数据" icon="https://sass-test.doit10019.com/upload/202501/08114139-33838600519097990.jpg?attname=coupon.jpg" />
		<!-- 场馆 -->
		<con-alert :show="alertShow" @close="close" title="适用场馆" @touchmove.stop.prevent="">
			<!-- <view class="select-list"> -->
			<scroll-view :scroll-top="scrollTop" scroll-y="true" class="select-list">
				<view class="item flex-align" v-for="(item,index) in ticketData" :key="index">
					<view class="image">
						<u--image radius="5" :src="item.venue_thumb" width="100%" height="100%"></u--image>
					</view>
					<view class="detail">
						<view>
							<view class="name">
								{{ item.venue_name }}
							</view>
							<view class="timer"> 营业时间：{{ item.open_time }} </view>
						</view>

						<view class="flex-between bottom">
							<view class="flex-align" style="width: 70%">
								<u-icon name="map-fill" color="#cacaca" size="12"></u-icon>
								<text class="address">{{ item.address }}</text>
							</view>
							<!-- <view class="flex-align" @click="phone(item , index)"> -->
							<view class="flex-align">
								<text>{{ item.phone }}</text>
								<u-icon name="phone" color="#cacaca" size="12"></u-icon>
							</view>
						</view>
					</view>
				</view>
				<!-- </view> -->
			</scroll-view>
		</con-alert>
		<!-- 底部导航组件 -->
		<tarbar :valueModel="tabbar_index" :footerArr="homeData.footer"></tarbar>
	</view>

</template>

<script>
	import tarbar from '@/components/tarbar/index.vue'
	import conAlert from "@/components/com-alert/com-alert.vue";
	import {
		serialize
	} from '@/utils/util.js';
	const index = require('@/api/personal/index.js')
	const person = require("@/api/personal/index.js");
	import QSNavbar from "@/components/QS-Navbar/QS-Navbar.vue";
	export default {
		components: {
			conAlert,
			tarbar,
			QSNavbar,
		},
		data() {
			return {
				is: 1,
				data: null,
				// tabbar_index: 2,
				tabbar_index: 0,
				currentTab: 0,
				tabsList: [],
				list: [],
				assetsPath: this.$https.assetsPath,
				homeData: {},
				show: false,
				type: '',
				alertShow: false,
				ticketData: [],
				totalPage: "",
				status: "loading",
				detail: {
					list: [],
					tabList: [], //图标菜单
					hiddenTab: false, //隐藏tab
				},
				page: 1,
				page_url:'/pages/consumption-code/consumption-code',
				// navbarItems_1: [{
				// 	layout: "left",
				// 	type: "text",
				// 	text: "消费码",
				// 	width: 15,
				// 	weight: "bold",
				// 	color: "#000",
				// }, ],
				navbarItems_1: [{
					type: 'text',
					text: '消费码',
					width: 70,
					weight: 'bold',
					color: '#000',
					textAlign: 'left'
				}],
			}
		},
		onLoad(options) {
			// this.getTicketList()
			Object.keys(options).length && (this.data = options);
			// 查询对应小程序的配置信息
			this.getAppletConfig()
			this.getXiaoFeiMaTopText()
			
		},
		methods: {
			close() {
				this.alertShow = false;
			},
			//适用场馆
			async getXiaoFeiMaTopText(item) {
				let data = {
					app_id: this.$https.weixinAppId,
					project_id: getApp().globalData.projectId,
					open_id: uni.getStorageSync("openid"),
				}
				// let result = await index.showVenues(data)
				person.getXiaoFeiMaTopText(data).then(result => {
					if (result.code == 1) {
						this.tabsList = result.data.result
						if (result.data.result[0].type == 'ticket') {
							this.type = 'ticket';
							this.getTicketList();
						} else if (result.data.result[0].type == 'card') {
							this.type = 'card';
							this.getList()
						} else if (result.data.result[0].type == 'court') {
							this.type = 'court';
							this.getMyCourt()
						} else if (result.data.result[0].type == 'enroll') {
							this.type = 'enroll';
							this.getMyEnroll()
						} else if (result.data.result[0].type == 'train') {
							this.type = 'train';
							this.codeslist();
						}
					}else{
						this.tabsList == []
					}

				})
			},
			//适用场馆
			async showVenues(item) {
				let data = {
					app_id: this.$https.weixinAppId,
					project_id: getApp().globalData.projectId,
					type: this.type,
					product_id: item.product_id
				}
				// let result = await index.showVenues(data)
				person.showVenues(data).then(result => {
					if (result.code == 1) {
						this.ticketData = result.data.result
						this.alertShow = true;
					}
				})
			},
			// 培训
			async codeslist() {
				let postData = {
					project_id: getApp().globalData.projectId,
					appid: this.$https.weixinAppId,
					openid: uni.getStorageSync('openid'),
					pageSize:5,
					page:this.page,
					user_id: uni.getStorageSync("phone"),
				};
				let res = await person.codes(postData);
				if (res.code == 1) {
					// that.list = that.list.concat(res.data.result); //将数据拼接在一起
					// that.totalPage = res.data.page
					if (this.detail.list.length < 1) {
						this.detail.list = res.data.classData.data
					} else {
						this.detail.list.push(...res.data.classData.data);
					}
					this.status = "loadmore";
			
					if (res.data.classData.data.length < 5) {
						this.status = "nomore";
					}
				}
			},
			// 赛事
			async getMyEnroll() {
				
				let postData = {
					project_id: getApp().globalData.projectId,
					app_id: this.$https.weixinAppId,
					status: 0,
					open_id: uni.getStorageSync('openid'),
					limit: 5,
					page: this.page,
				};
				let res = await person.getMyEnroll(postData);
				if (res.code == 1) {
					// that.list = that.list.concat(res.data.result); //将数据拼接在一起
					// that.totalPage = res.data.page
					if (this.detail.list.length < 1) {
						this.detail.list = res.data.result;
					} else {
						this.detail.list.push(...res.data.result);
					}
					this.status = "loadmore";

					if (res.data.result.length < 5) {
						this.status = "nomore";
					}
				}
			},

			async getAppletConfig() {
				let data = {
					weixinAppId: this.$https.weixinAppId,
					projectId: getApp().globalData.projectId, 
				}
				let result = await index.index(data)
				if (result.code == 1) {
					this.homeData = result.data // 首页完整数据
					this.homeData.footer.forEach((item,index)=>{
						if (this.page_url == item.page_url) {
							this.tabbar_index = index
						} 
					})
					this.$nextTick(function(e) {
						this.homeData.footer[this.tabbar_index].this_icon = this.homeData.footer[this
							.tabbar_index].selected_icon
					}) // 默认选中底部Tabbar
				}
			},
			// 获取我的卡包
			async getList() {
				let params = {
					project_id: getApp().globalData.projectId,
					user_id: uni.getStorageSync('phone'),
					open_id: uni.getStorageSync("openid"),
					appid: this.$https.weixinAppId,
					expired: 0,
					limit: 5,
					page: this.page,
				}
				let res = await index.getMyCard(params)
				if (res.code === 1) {
					if (this.detail.list.length < 1) {
						this.detail.list = res.data.cardData;
					} else {
						this.detail.list.push(...res.data.cardData);
					}
					this.status = "loadmore";
					if (res.data.cardData.length < 5) {
						this.status = "nomore";
					}
				}
			},
			// 获取票据列表
			async getTicketList() {
				let postData = {
					project_id: getApp().globalData.projectId,
					open_id: uni.getStorageSync("openid"),
					appid: this.$https.weixinAppId,
					expired: 0,
					limit: 5,
					page: this.page,
				};
				let res = await person.getMyTicket(postData);
				if (res.code === 1) {
					if (this.detail.list.length < 1) {
						this.detail.list = res.data.ticketData;
					} else {
						this.detail.list.push(...res.data.ticketData);
					}
					this.status = "loadmore";

					if (res.data.ticketData.length < 5) {
						this.status = "nomore";
					}
				}
			},
			// 获取我的场地详情
			async getMyCourt() {
				let params = {
					project_id: getApp().globalData.projectId,
					app_id: this.$https.weixinAppId,
					open_id: uni.getStorageSync("openid"),
					// status: 0,
					id: '',
					expired: this.currentTab,
					limit: 5,
					page: this.page,
				}
				let res = await index.getMyCourt(params)
				if (res.code === 1) {
					if (this.detail.list.length < 1) {
						this.detail.list = res.data.ticketData;
					} else {
						this.detail.list.push(...res.data.ticketData);
					}
					this.status = "loadmore";

					if (res.data.ticketData.length < 5) {
						this.status = "nomore";
					}
				}
			},
			loadNewsList() {
				if (this.type == 'ticket') {
					this.status = "loading";
					this.page += 1;
					this.getTicketList();
				} else if (this.type == 'card') {
					this.status = "loading";
					this.page += 1;
					this.getList();
				} else if (this.type == 'court') {
					this.status = "loading";
					this.page += 1;
					this.getMyCourt();
				} else if (this.type == 'enroll') {
					this.status = "loading";
					this.page += 1;
					this.getMyEnroll();
				}else if (this.type == 'train') {
					this.status = "loading";
					this.page += 1;
					this.codeslist();
				}

			},
			search(val) {
				if (this.type == 'ticket') {
					this.page = 1;
					this.detail.list = [];
					this.status = "loading";
					this.getTicketList(val);
				} else if (this.type == 'card') {
					this.page = 1;
					this.detail.list = [];
					this.status = "loading";
					this.getList();
				} else if (this.type == 'court') {
					this.page = 1;
					this.detail.list = [];
					this.status = "loading";
					this.getMyCourt();
				} else if (this.type == 'enroll') {
					this.page = 1;
					this.detail.list = [];
					this.status = "loading";
					this.getMyEnroll();
				}else if (this.type == 'train') {
					this.page = 1;
					this.detail.list = [];
					this.status = "loading";
					this.codeslist();
				}

			},
			// onClickTab({
			// 	index
			// }) {
			// 	this.currentTab = index;
			// 	this.list = []
			// 	if (index == 0) {} else if (index == 1) {
			// 		this.getTicketList();
			// 	} else if (index == 2) {
			// 		this.getList()
			// 	}
			// },
			onClickTab(it) {
				this.list = []
				this.detail.list = []
				this.page = 1
				if (it.type == "ticket") {
					this.type = 'ticket';
					this.getTicketList();
				} else if (it.type == "card") {
					this.type = 'card';
					this.getList()
				} else if (it.type == "court") {
					this.type = 'court';
					this.getMyCourt()
				} else if (it.type == "enroll") {
					this.type = 'enroll';
					this.getMyEnroll()
				} else if (it.type == "train") {
					this.type = 'train';
					this.codeslist()
				}
			},
			onClick(item) {
				// uni.reLaunch({
				// 	url: `/pages/consumption-code/choose/choose?${serialize(item)}`
				// });
				//  var textObj = JSON.stringify(item)
				// if (this.type == 0) {
				// 	if (item.ticket != '') {
				// 		//票
				// 		uni.navigateTo({
				// 			url: '/pages/consumption-code/choose/choose?type=' + this.type +
				// 				'&ticket_no=' +
				// 				item.ticket_no
				// 		})
				// 	} else if(item.card != ''){
				// 		//卡
				// 		uni.navigateTo({
				// 			url: '/pages/consumption-code/choose/choose?type=' + this.type +
				// 				'&cardno=' +
				// 				item.cardno
				// 		})
				// 	}
				// } else
				if (this.type == 'ticket') {
					uni.navigateTo({
						url: '/pages/consumption-code/choose/choose?type=' + this.type +
							'&ticket_no=' + item.ticket_no
					})
				} else if (this.type == 'card') {
					uni.navigateTo({
						url: '/pages/consumption-code/choose/choose?type=' + this.type +
							'&cardno=' +
							item.cardno +
							'&id=' +
							item.id
					})
				} else if (this.type == 'court') {
					uni.navigateTo({
						url: '/pages/consumption-code/choose/choose?type=' + this.type +
							'&court_no=' +
							item.court_no +
							'&product_id=' +
							item.product_id +
							'&sender=' +
							item.usermobile +
							'&beShare=' +
							item.beShare  +
							'&id=' +
							item.id+
							'&title=' +
							'我的场地'
					})
				} else if (this.type == 'enroll') {
					uni.navigateTo({
						url:'/pages_a/my-event/event_code?id=' + item.rid
						// url:'../ ?id=' + item.id
					})
				}else if (this.type == 'train') {
					uni.navigateTo({
						url: '/pages_a/my-lesson/class-detail/class-detail?student_id=' + item.student_id + '&id=' + item.id,
					});
					// uni.navigateTo({
						// url:'/pages_a/my-lesson/lesson_code?goods_id=' + item.id + '&student_id=' +item.student_id
					// })
				}

			}
		}
	}
</script>

<style lang="scss" scoped>
	.choose {
		width: 100%;
		height: 100vh;
		// height: calc(100vh + 130rpx );
		background-color: #f3f3f3;
		padding-bottom: env(safe-area-inset-bottom);
		overflow-y: auto;

		.blues {
			color: #2f75fa;
		}

		.blacks {
			color: #828282;
		}

		/deep/.u-tabs {
			background-color: #fff;
			padding: 0 20rpx;

			.u-tabs__wrapper__nav__line {
				bottom: 0;
			}
		}

		.choose-list {
			padding: 0rpx 20rpx 20rpx 20rpx;

			.item {
				border-radius: 20rpx;
				padding: 30rpx 24rpx 0;
				background-color: #fff;
				// margin-bottom: 30rpx;
				margin-top: 30rpx;

				.right-content {
					margin-left: 30rpx;
					justify-content: space-between;
					font-size: 28rpx;
					color: rgb(51, 51, 51);
				}

				.date {
					display: inline-block;
					background-color: #f3f3f3;
					color: #888;
					font-size: 24rpx;
					border-radius: 100px;
					padding: 5rpx 10rpx;
				}

				.bottom {
					margin-top: 30rpx;

					/deep/.u-button {
						width: 174rpx;
						height: 60rpx;
					}
				}

				.it {
					padding: 36rpx 0;

					&+.it {
						border-top: 1px solid rgb(243, 243, 243);
					}
				}
			}
		}

		// 弹窗

		.select-list {
			height: 50vh;
			overflow: auto;

			// padding-bottom: 30rpx;
			.item {
				margin-bottom: 20rpx;
				// padding-bottom: 20rpx;
				height: 150rpx;
				border-bottom: 1px solid #cccccc;

				&:last-of-type {
					border: none;
					margin: 0;
					padding: 0;
				}

				.image {
					width: 150rpx;
					height: 100%;

					/deep/ .vue-ref {
						width: 100%;
						height: 100%;
					}
				}

				.detail {
					display: flex;
					height: 100%;
					flex: 1;
					width: 0;
					margin-left: 20rpx;
					flex-direction: column;
					justify-content: space-between;

					.name {
						font-weight: 700;
						font-size: 28rpx;
						margin-bottom: 15rpx;
					}

					.timer {
						color: #cacaca;
						font-size: 20rpx;
					}

					.bottom {
						font-size: 20rpx;
						color: #cacaca;

						.address {
							width: 70%;
							white-space: nowrap;
							overflow: hidden;
							text-overflow: ellipsis;
						}
					}
				}
			}
		}
	}
</style>
